<?php
namespace app\admin\controller;
use \think\Controller;
use \think\Session;
use \think\Db;
class News extends Common
{
	public function index(){

		if(input('newsid')=='')
			$result = Db::name('news')->alias('a')->join('city b','a.city_id=b.city_id')->order('news_id')->order('a.city_id')->select();
		else
			$result = Db::name('news')->where('news_id',input('newsid'))->alias('a')->join('city b','a.city_id=b.city_id')->select();
		$this->assign('newslist',$result);
		return $this->fetch();
	}

	
}